home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / wics.zip / DEDTWIN.H < prev    next >
C/C++ Source or Header  |  1993-03-05  |  3KB  |  89 lines

  1. //==============================================================================================
  2. //
  3. //    WICS Demonstration Application
  4. //    Version 1.00
  5. //
  6. //    DEMO.CPP main application code file
  7. //    February 1993
  8. //
  9. //==============================================================================================
  10. //
  11. //    Abstract:
  12. //
  13. //
  14. //==============================================================================================        
  15.  
  16. #ifndef _DEDTWIN_H
  17. #define _DEDTWIN_H
  18.  
  19. #include <owl.h>
  20. #include <wics.h>
  21. #include <demorc.h>
  22. #include <demo.h>
  23. #include <eframe.h>
  24. #include <filewnd.h>
  25.  
  26. _CLASSDEF (TDemoEditWindow)
  27. _CLASSDEF (TDemoPrintedPage);
  28.  
  29. class TDemoPrintedPage : public TPrintedPage
  30. {
  31.     PTEdit        AnEditor;
  32.     LOGFONT FAR *lpLogFont;
  33.     int            iLine;
  34.     int            iOffsetToLine;
  35.     BOOL        fAnotherPage;
  36.  
  37. public:
  38.     TDemoPrintedPage (Pchar ATitle, PTEdit pe, LOGFONT FAR * lplf);
  39.     virtual void PrintPage (HDC hDC, WORD page, POINT size, POINT dpi);
  40.     virtual BOOL  IsNextPage() { return fAnotherPage; }
  41. };
  42.  
  43. class TDemoEditWindow : public TFileWindow
  44. {
  45. private:
  46.     HFONT        hFont;
  47.     COLORREF    rgbTextColor;
  48.     LOGFONT        lf;
  49.     FINDREPLACE    fr;
  50.  
  51.     virtual PTExtendedMDIFrame GetParent () { return (PTExtendedMDIFrame) Parent; } ;
  52.  
  53. protected:
  54.     virtual LPSTR GetClassName() { return "DEMOEDTWIN"; }
  55.     virtual void SetupWindow() ;
  56.     virtual void CheckMenu (UINT id) { GetParent()->CheckMenu(id); }
  57.     virtual void UncheckMenu (UINT id) { GetParent()->UncheckMenu(id); }
  58.     virtual void EnableMenuEntry(UINT id) { GetParent()->EnableMenuEntry(id); }
  59.     virtual void DisableMenuEntry(UINT id) { GetParent()->DisableMenuEntry(id); }
  60.     virtual void FindEditorText () { Editor->Search (-1, fr.lpstrFindWhat, fr.Flags & FR_MATCHCASE); }
  61.     virtual void ReplaceEditorText();
  62.     virtual void ReplaceAllEditorText();
  63.  
  64.     virtual void CMChangeFont (RTMessage) = [CM_FIRST + CM_CHANGEFONT];
  65.     virtual void CMBold (RTMessage) = [CM_FIRST + CM_BOLD];
  66.     virtual void CMItalic (RTMessage) = [CM_FIRST + CM_ITALIC];
  67.     virtual void CMFontChanged (RTMessage) = [CM_FIRST + CM_FONTCHANGED];
  68.     virtual void CMFontSizeChanged (RTMessage) = [CM_FIRST + CM_FONTSIZECHANGED];
  69.     virtual void WMCommand (RTMessage) = [WM_FIRST + WM_COMMAND];
  70.     virtual void CMFileSaveAs (RTMessage) = [CM_FIRST + CM_FILESAVEAS];
  71.     virtual void CMPrint(RTMessage) = [CM_FIRST + CM_PRINT];
  72.     virtual void CMFind (RTMessage) = [CM_FIRST + CM_FIND];
  73.     virtual void CMReplace (RTMessage) = [CM_FIRST + CM_REPLACE];
  74.  
  75.     virtual void ENSetFocus ();
  76.     virtual void ENKillFocus ();
  77.  
  78. public:
  79.     TDemoEditWindow (PTWindowsObject AParent, LPSTR ATitle, LPSTR AFile);
  80.     ~TDemoEditWindow ();
  81.  
  82.     virtual void GetWindowClass(WNDCLASS& WndClass);
  83.     virtual PTPrinter GetPrinter() { return ((PTExtendedMDIFrame)GetParent())->GetPrinter(); }
  84.     virtual void DefWndProc(RTMessage Msg);
  85. };
  86.  
  87. #endif
  88.  
  89.